package com.service.impl;

import com.entity.Addinto;
import com.entity.Outstorage;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.OutstorageMapper;
import com.service.OutstorageService;
import com.vo.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author :hcy
 * @date:
 * @description:
 */
@Service
public class OutstorageServiceImpl implements OutstorageService {
    @Resource
    private OutstorageMapper outstorageMapper;
    @Override
    public PageInfo<Outstorage> listAllOutstorage(Page<Outstorage> page) {
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo(outstorageMapper.listAllOutstorage(page.getData()));
    }

    @Override
    public Outstorage getByIdOutstorage(Integer outstorageId) {
        return outstorageMapper.getByIdOutstorage(outstorageId);
    }

    @Override
    public int addOutstorage(Outstorage outstorage) {
        return outstorageMapper.addOutstorage(outstorage);
    }

    @Override
    public int updateOutstorage(Outstorage outstorage) {
        return outstorageMapper.updateOutstorageId(outstorage);
    }

    @Override
    public int deleteOutstorage(Integer outstorageId) {
        return outstorageMapper.deleteOutstorage(outstorageId);
    }
}
